package cn.iocoder.yudao.module.wengfu.controller.admin.base.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDate;
import javax.validation.constraints.*;
import java.math.BigDecimal;

@Schema(description = "管理后台 - 样品基础信息新增/修改 Request VO")
@Data
public class SampleBaseInfoSaveReqVO {

    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19123")
    private Long id;

    @Schema(description = "取样编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32561")
    @NotEmpty(message = "取样编号不能为空")
    private String sampleId;

    @Schema(description = "化验编号", example = "7009")
    private String testId;

    @Schema(description = "样品类型：1-了解样, 2-流程样, 3-结算样", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotNull(message = "样品类型不能为空")
    private Integer sampleType;

    @Schema(description = "样品名称", example = "样品A")
    private String sampleName;

    // ==================== 时间字段（对应DO的时间字段） ====================

    @Schema(description = "取样时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonFormat(pattern = "yyyy-MM-dd")   // 前端请使用同样格式的字符串
    @NotNull(message = "取样时间不能为空")
    private LocalDate sampleTime;

    @Schema(description = "接样时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDate takerTime;

    // ==================== 人员字段（对应DO的人员字段） ====================
    @Schema(description = "送样人员", requiredMode = Schema.RequiredMode.REQUIRED)
//    @NotEmpty(message = "送样人员不能为空")
    private String sampleSender;

    @Schema(description = "接样人员", requiredMode = Schema.RequiredMode.REQUIRED)
//    @NotEmpty(message = "接样人员不能为空")
    private String sampleTaker;

    @Schema(description = "其他人员")
    private String otherPersonnel;

    // ==================== 矿石来源信息（对应DO的字段） ====================
    @Schema(description = "客户归属：1-销售集团内 2-销售集团外（仅结算样填写）")
    private Integer customerAffiliation;

    @Schema(description = "发矿单位")
    private String miningUnit;

    @Schema(description = "发矿地点")
    private String miningLocation;

    @Schema(description = "收矿地点")
    private String receivingLocation;

    @Schema(description = "取样地点")
    private String samplingLocation;

    @Schema(description = "矿石种类", example = "2")
    private String oreType;

    @Schema(description = "矿石属性")
    private String oreProperty;

    @Schema(description = "数量")
    private BigDecimal quantity;

    // ==================== 分析信息（对应DO的字段） ====================
    @Schema(description = "分析项目（P2O5,MgO,H2O,全分析,手工分析）", requiredMode = Schema.RequiredMode.REQUIRED)
    private String analyzeProject;

    @Schema(description = "水分(H2O)")
    private BigDecimal h2o;

    // ==================== 审批信息（对应DO的字段） ====================
    @Schema(description = "审批状态：0-待提交 1-审批中 2-已通过 3-已驳回 4-已撤回", example = "0")
    private Integer approvalStatus;

    @Schema(description = "备注", example = "备注信息")
    private String remark;

    // ==================== 前端特有的字段（需要手动处理） ====================

    @Schema(description = "了解样-接样人员")
    private String knowledgeSampleReceiver;

    @Schema(description = "出矿采场")
    private String miningField;

    @Schema(description = "收矿厂家")
    private String miningSupplier;
}
